#ifndef STR_H
#define STR_H

#include "Type.h"
#include "List.h"
typedef struct String{
	OBJECT_HEAD
	char* str;
	int length;
}String;

//String对象的方法

void string_init(String*, const char*, int length);
String* string_allocate(const char* chs);
String* string_allocate_const(const char* chs, int length);
void string_destroy(String* self);
Object* str_allocate_instance(Object*);

Object* addString(Object*, Object*);


void printString(Object* self);

int hashString(Object*);

Object* greaterString(Object* self, Object* other);

Object* lessString(Object* self, Object* other);

Object* equalString(Object* self, Object* other);

Object* neqString(Object* self, Object* other);

Object* geString(Object* self, Object* other);

Object* leString(Object* self, Object* other);


Object* pvm_str_init(List* args);

//定义了一个全局的IntegerType变量并初始化，存放在数据段。

void pvm_init_str();

extern Type StringType;





//虚函数的实现

#endif



